<tagLib name="html" />
<include file="Public:header" />
<load href ="__PUBLIC__/Js/common.js" />
<div id="main" class="main" >
<script language="JavaScript">
<!--
function checkName(){
	ThinkAjax.send('__URL__/checkAccount/','ajax=1&account='+$F('account'));
}
function checkCardNumber(){
	ThinkAjax.send('__URL__/checkCardNumber/','ajax=1&number='+$F('card_number'));
}
function checkCardSerial(){
	ThinkAjax.send('__URL__/checkCardSerial/','ajax=1&serial='+$F('cardSerial'));
}
function getCardTypeMoney(typeId){
	$('typeName').value = $('cardTypeId')[$('cardTypeId').selectedIndex].innerText;
    ThinkAjax.send('__URL__/getCardTypeMoney/','typeId='+typeId,insertMoney,'','');
}
function insertMoney(json){
	$('money').innerHTML='￥'+json.money;
}
function inputPassword(){
	$('password').value=$('telephone').value;
}

function setSalerName(){
	$('salerName').value = $('salerId')[$('salerId').selectedIndex].innerText;
}
/*function check(form){
	alert(form);
	return true
}*/
//-->
</script>
<div class="content">
<div class="title">新增会员 [ <a href="__URL__">返回列表</a> ]</div>
<table cellpadding=3 cellspacing=3>
<form method='post' id="form1" action="__URL__/insert/" >
<tr>
	<td class="tRight" >用户名：</td>
	<td class="tLeft" ><input type="text" class="medium bLeftRequire"  check='Require' warning="用户名不能为空" id="account" name="account" value="{$vo.account}"><input type="button" value="检测帐号" onclick="checkName()" class="submit hMargin"></td>
	<td class="tRight" >真实姓名：</td>
	<td class="tLeft" ><input type="text" class="medium bLeftRequire" name="trueName" value=""></td>
</tr>
<tr>
	<td class="tRight" >生日：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="birthday" value="" onclick=ShowCalendar(this)></td>
	<td class="tRight">性别：</td>
	<td class="tLeft"><SELECT class="small bLeft"  name="sex">
	<option value="0">女</option>
	<option value="1">男</option>
	</SELECT></td>
</tr>
<tr>
	<td class="tRight" >手机号码：</td>
	<td class="tLeft" ><input type="text" class="medium bLeftRequire" name="telephone" value="" id="telephone" onkeyup="inputPassword()" ></td>
	<td class="tRight" >密码：</td>
	<td class="tLeft" ><input type="password" class="medium bLeftRequire" id="password" name="password" value=""></td>
</tr>
<tr>
	<td class="tRight">状态：</td>
	<td class="tLeft"><SELECT class="small bLeft"  name="status">
	<option value="1">启用</option>
	<option value="0">禁用</option>
	</SELECT></td>
	<td class="tRight">销售顾问：</td>
	<td class="tLeft">
	<SELECT class="middle bLeft"  name="salerId" id="salerId" onchange="setSalerName()" >
		<option value="0">请选择销售顾问</option>
		<volist name="salers" id="ss">
			<option value="{$ss.id}">{$ss.nickname}</option>
		</volist>
	</SELECT>
	<input type="hidden" id="salerName" name="salerName" value=''/>
	</td>
</tr>
<tr><td colspan='4'><hr/></td></tr>
<tr>
	<td class="tRight" >会员卡序列号：</td>
	<td class="tLeft" ><input type="text" class="medium bLeftRequire" id="cardSerial" name="cardSerial" value="{$cardSerial}"/><input type="button" value="检测序列号" onclick="checkCardSerial()" class="submit hMargin"></td>
	<td class="tRight" >卡号：</td>
	<td class="tLeft" ><input type="text" class="medium bLeftRequire" id='card_number' name="cardNumber" value=""/><input type="button" value="检测卡号" onclick="checkCardNumber()" class="submit hMargin"></td>
</tr>
<tr>
	<td class="tRight">会员卡：</td>
	<td class="tLeft">
	<SELECT class="middle bLeft"  name="cardTypeId" id="cardTypeId" onchange="getCardTypeMoney(this.value)">
		<option value="0">请选择开卡类型</option>
		<volist name="card_type_list" id="ctl">
			<option value="{$ctl.id}">{$ctl.name}</option>
		</volist>
	</SELECT>
	<input type="hidden" id="typeName" name="typeName" value=''>
	</td>

	<td class="tRight" >金额：</td>
	<td class="tLeft" id="money">￥</td>
</tr>
<tr>
	<td class="tRight">付款方式：</td>
	<td class="tLeft"><SELECT class="small bLeft"  name="payType">
	<option value="1">刷卡</option>
	<option value="0">现金</option>
	</SELECT></td>
	<td class="tRight" >支付金额：</td>
	<td class="tLeft" ><input type="text" class="small bLeftRequire" name="payMoney" value=""></td>
</tr>
<tr>
	<td class="tRight tTop">流水号：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="payNumber" value=""></td>
	<td class="tRight tTop">操作人：</td>
	<td class="tLeft" >{$Think.session.loginUserName}</td>
</tr>

<tr>
	<td class="tRight tTop">喜  好：</td>
	<td class="tLeft"><TEXTAREA class="large bLeft"  name="hobby" rows="5" cols="57"></textarea></td>
	<td class="tRight tTop">备  注：</td>
	<td class="tLeft"><TEXTAREA class="large bLeft"  name="remark" rows="5" cols="57"></textarea></td>

</tr>
<tr>
	<td></td>
	<td class="center">
	<input type="submit" value="保 存" class="small submit">
	<input type="reset" class="submit  small" value="清 空" >
	</td>
</tr>
</table>
</form>
</div>
</div>
